package com.wzh.codegen.biz.domain.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

/**
 * 代码生成服务DTO
 *
 * @author wzh
 * @since 2024-01-01
 */
@Data
@Schema(description = "代码生成服务DTO")
public class CodegenServiceDTO {

    @Schema(description = "服务名称")
    @NotBlank(message = "服务名称不能为空")
    @Pattern(regexp = "^[a-z][a-z0-9-]*[a-z0-9]$", message = "服务名称只能包含小写字母、数字和连字符，且必须以字母开头和结尾")
    private String serviceName;

    @Schema(description = "服务描述")
    private String serviceDescription;

    @Schema(description = "包名")
    @NotBlank(message = "包名不能为空")
    @Pattern(regexp = "^[a-z][a-z0-9]*(\\.[a-z][a-z0-9]*)*$", message = "包名格式不正确")
    private String packageName;

    @Schema(description = "生成路径")
    @NotBlank(message = "生成路径不能为空")
    private String generatePath;

    @Schema(description = "作者")
    private String author;

    @Schema(description = "是否包含API模块")
    private Boolean includeApi = true;

    @Schema(description = "是否包含Swagger文档")
    private Boolean includeSwagger = true;

    @Schema(description = "是否包含Feign客户端")
    private Boolean includeFeign = true;

}
